<!-- 原捆绑商品 -->
<!--<div class="goods-detail-tab clearfix"> </div>
-->

<div class="clear"></div>
<{foreach from=$addons item=tmpl}>
<{require file=$tmpl}>
<{/foreach}>
<div class="goodsDetailContent"> <{if $goods.description}>
  <div class="section pdtdetail" tab="<{t}>商品详情<{/t}>">
    <div class="body indent uarea-output" >
      <ul class="goods-intro-list clearfix" >
        <li title="" ><{t}>编号：<{/t}><{$goods.bn}></li>
        <li title="" ><{t}>货号：<{/t}><{if $goods.product_bn}><{$goods.product_bn}><{else}><{$product0bn.bn}><{/if}></li>
        <{if $goods.brand.brand_name}>
        <li title=""><{t}>品牌：<{$goods.brand.brand_name}><{/t}></li>
        <{/if}>
        <li title=""><{t}>价格区间
          <{if $goods.minmktprice && $goods.maxmktprice}>
          <{$goods.minmktprice|cur_odr:$order.currency}>&nbsp;-&nbsp;<{$goods.maxmktprice|cur_odr:$order.currency}>
          <{else}>
          <{$goods.mktprice|cur_odr:$order.currency}>
          <{/if}>
          <{/t}> </li>
        <{if $env.conf.b2c.goodsprop.display.position != 1}>
        <{foreach from=$goods.type.props item=propord key=key}>
        <{if $propord.show}>
        <{assign var="pkey" value="p_{$key}"}>
        <{assign var="pcol" value=$goods.props.$pkey.value}>
        <{if trim($pcol) !== ''}>
        <li> <span><{$propord.name}>：</span> <{if $propord.type == 'select'}>
          <{if $env.conf.b2c.goodsprop.display.switch == 'true'}><a href="<{selector args=array("{$goods[category][cat_id]}") value="{$goods[category][cat_id]}" filter=array('cat_id'=>array("{$goods[category][cat_id]}"),"p_{$key}"=>array($pcol))}>" target="_blank"><{$propord.options.$pcol}></a><{else}><{$propord.options.$pcol}><{/if}>
          <{else}>
          <{$pcol}>
          <{/if}> </li>
        <{/if}>
        <{/if}>
        <{/foreach}>
        <{/if}>
      </ul>
    </div>
    <div id="goods-intro" style="padding:10px"> <{$goods.description|lazyimg}> </div>
    <script>
    new DataLazyLoad({img:'lazy-load-img',lazyDataType:'img'},$('goods-intro'));
</script>
    <div class="goods-intro-shop">
      <div style=" background:#fff; padding:10px 0">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <th  class="goods-introbtn" width="35%"> <{t}>现价：<{/t}><span class="fontcolorRed font20px fontbold price1"><{if $goods.minprice && $goods.maxprice}>
              <{$goods.minprice|cur_odr:$order.currency}>&nbsp;-&nbsp;<{$goods.maxprice|cur_odr:$order.currency}>
              <{else}>
              <{$goods.current_price|cur_odr:$order.currency}>
              <{/if}></span></th>
            <td width="65%" align="left"><div class="floatLeft"> <{if count($goods.products)>0}>
                <{if $env.conf.system.goods.fastbuy}>
                <input class="actbtn btn-fastbuy" value="<{t}>立即购买<{/t}>" type="button" />
                <{/if}>
                <input class="actbtn btn-buy" value="<{t}>加入购物车<{/t}>" type="submit" />
                <input  class="actbtn btn-notify" value="<{t}>缺货登记<{/t}>" type="submit" style="display: none;" />
                <{else}>
                <{if $goods.store-$goods.freez>0 || $goods.store==='' || $goods.store === null}>
                <{if $env.conf.system.goods.fastbuy}>
                <input class="actbtn btn-fastbuy" value="<{t}>立即购买<{/t}>" type="button" />
                <{/if}>
                <input class="actbtn btn-buy" value="<{t}>加入购物车<{/t}>" type="submit" />
                <{else}>
                <input  class="actbtn btn-notify" value="<{t}>缺货登记<{/t}>" type="submit" />
                <{/if}>
                <{/if}> </div>
              <div class="floatLeft" style="margin:12px 0 0 5px">
                <ul class="button">
                  <li class="star-off" <{if $login!="nologin"}>star="<{$goods.goods_id}>"<{/if}> title="<{$goods.name|escape:html}>"> <a  <{if $login=="nologin"}> href="<{link app="b2c" ctl="site_passport" act="login"}>" <{else}>href="#" onclick="return false;"<{/if}> class="btn-a listact"  rel="nofollow" ><i class="has-icon"> <img src='<{$env.app.res_url}>/bundle/collect_icon.gif' /></i><span >
                  <div class="fav"><{t}>收藏此商品<{/t}></div>
                  <div class="nofav"><{t}>已收藏<{/t}></div>
                  </span></a>
                  </li>
                </ul>
              </div></td>
          </tr>
        </table>
      </div>
    </div>
    <div class="referbox"> </div>
  </div>
  <{/if}>
  
  <{if count($goods.params)>0 && $goods.params}>
  <div class="section pdtdetail" style="display:none" tab="<{t}>详细参数<{/t}>" >
    <h2><{t}>详细参数<{/t}></h2>
    <div class="body"  id="goods-params">
      <table width="100%" cellpadding="0" cellspacing="0" class="liststyle data">
        <col class="span-4 ColColorGray fontcolorBlack">
        </col>
        
        <{foreach from=$goods.params item=params key=group}>
        <tr>
          <td colspan="2" class="colspan ColColorGraydark"><{$group}><span class="gname"></span></td>
        </tr>
        <{foreach from=$params item=value key=key}>
        <{if $value != ''}>
        <tr>
          <th><{$key}></th>
          <td><{$value|default:'-'}></td>
        </tr>
        <{/if}>
        <{/foreach}>
        <{/foreach}>
      </table>
    </div>
  </div>
  <{/if}>
  <{if $goods.link_count > 0}>
  <div class="section pdtdetail" style="display:none" tab="<{t}>相关商品<{/t}>">
    <h2 style="border-bottom:1px solid #ddd"><{t}>相关商品<{/t}></h2>
    <div class="body" id="goods-rels">
      <div class="GoodsSearchWrap">
        <table width="100%" border="0" cellpadding="0" cellspacing="6">
          <tr valign="top"> <{foreach from=$goods.link item=linklist name=goods}>
            <td product="<{$linklist.goods_id}>" width="26%"><div class="items-gallery">
                <div class="goodpic" style='<{if $env.conf.b2c.site.thumbnail_pic_width !=0 && $env.conf.b2c.site.thumbnail_pic_height !=0}>
              height:<{$env.conf.b2c.site.thumbnail_pic_height}>px;<{/if}>'> <a href='<{link app=b2c ctl=site_product act=index arg0=$linklist.goods_id}>' style='<{if $env.conf.b2c.site.thumbnail_pic_width !=0 && $env.conf.b2c.site.thumbnail_pic_width !=0}> width:<{$env.conf.b2c.site.thumbnail_pic_width}>px;height:<{$env.conf.b2c.site.thumbnail_pic_height}>px;<{/if}>;'> <img src="<{$linklist.image_default_id|storager:'s'}>" style=''/> </a></div>
                <div class="goodinfo">
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td colspan="2"><h6 style="text-align:center; margin:0; padding:0"><a href="<{link app=b2c ctl=site_product act=index arg0=$linklist.goods_id}>;" title="<{$linklist.name}>"><{$linklist.name}></a></h6></td>
                    </tr>
                    <tr>
                      <td colspan="2" align="center"><span class="price1"><{$linklist.price|cur_odr:$order.currency}></span> <{if $goods.setting.mktprice}> <span class="mktprice1"><{$linklist.mktprice|cur_odr:$order.currency}></span> <{/if}> </td>
                    </tr>
                    <tr>
                      <td><ul class="button" style="margin-top:6px">
                          <{goodsmenu product=$linklist setting=$setting login=$login}>
                          <li class="btncmp"> <a href="javascript:void(0)" onclick="gcompare.add({gid:'<{$linklist.goods_id}>',gname:'<{$linklist.name|escape:'quotes'}>',gtype:'<{$linklist.type_id}>'});" class="btncmp" title="商品对比"> </a> </li>
                        </ul></td>
                    </tr>
                  </table>
                </div>
              </div></td>
            <{if !($smarty.foreach.goods.iteration%4)}> </tr>
          <{if !$smarty.foreach.goods.last}>
          <tr valign="top"> <{/if}>
            
            <{elseif $smarty.foreach.goods.last}>
            <td colspan="<{math equation='4 - y' y=$smarty.foreach.goods.iteration%4}>">&nbsp;</td>
          </tr>
          <{/if}>
          <{/foreach}>
        </table>
      </div>
    </div>
  </div>
  <{/if}>
  
  <{if $comment.switch.discuss == 'on'}>
  <div class="section pdtdetail" style="display:none" tab="<{t}>商品评论<{/t}> (<em><{$comment.discussCount|default:'0'}></em>)">
  <h2 style="border-bottom:1px solid #ddd"><{t}>商品评论<{/t}></h2>
  	<{include file="site/product/discuss.html"}> 
  </div>
  <{/if}>
  
   <{if $comment.switch.ask == 'on'}>
   <div class="section pdtdetail" style="display:none" tab="<{t}>商品咨询<{/t}> (<em><{$comment.askCount|default:'0'}></em>)">
 	 <h2 style="border-bottom:1px solid #ddd"><{t}>商品咨询<{/t}></h2>
   	<{include file="site/product/consult.html"}> 
 </div>
  <{/if}>
  
  <div id='template-modal' style='display:none;'>
    <div class='dialog'>
      <div class='dialog-title clearfix'>
        <div class='title span-auto'>{title}</div>
        <div class='dialog-close-btn' onclick='$(this).getParent(".dialog").remove();'>X</div>
      </div>
      <div class='dialog-content'> {content} </div>
    </div>
  </div>
  <{if $comment.switch.ask == 'on' or $comment.switch.discuss == 'on'}>
  
  <script>
(function(){
	$$('.consult-panel').addEvent('click',function(e){
		//this.hide();
		if(!$(e.target).hasClass('repay_a'))return;
		if($('new_repay_box'))
		$('new_repay_box').remove();
		var replay_div = $('repay_box').clone();
		replay_div.setStyle('display','');
		var replay_form = replay_div.getFirst('form');
		new Request({
		url:'<{link app="b2c" ctl="site_comment" act="reply_link"}>',
        onComplete:function(response){
          replay_form.action = response;
        }
    }).post('comment_id='+$(e.target).id);
		replay_div.setProperty('id','new_repay_box');
		replay_div.inject($(e.target).getParent('div'),'after');
	});
})();

function cancle(){
	var new_repay_box = $('new_repay_box');
	if(new_repay_box){
		var span = new_repay_box.getPrevious('div').getFirst('span');
		span.show();
		new_repay_box.remove();
	}
	
}
</script>

  <script>

	    var checkFormReqs =function(e){
	           e    = new Event(e);
	       var _form= $(e.target);

	       var reqs = $$(_form.getElements('input[type=text]'),_form.getElements('textarea'));


	       if(reqs.some(function(req){
	            if(!req.get('required')&&!req.get('vtype').contains('required'))return;
	            if(req.getValue().trim()==''){
	                       req.focus();
	                       MessageBox.error('<{t}>请完善表单必填项<{/t}><sup>*</sup>');
	                       return true;
	            }

	              return false;


	       })){

	           e.stop();

	       }

	    };

function replyVcodeCheck(input){
  new Request.HTML({
	url:'<{link app=b2c ctl=site_comment act=vocdecheck}>',
	update:$(input).getNext('span'),
	method:'post',
	data:'name='+encodeURIComponent(input.value=input.value.trim())
	}).send();
}

function changereplyimg(a){
	 a.getPrevious('img').set('src','<{link app="b2c" ctl="site_comment" act="gen_replyvcode"}>#'+$time());
}

function showvcode(input){
	if (input.retrieve('showvcode',false))return;
	var vcodeImg = input.getNext('img');
	vcodeImg.src = vcodeImg.get('codesrc')+'?'+$time();
	vcodeImg.show();
	input.store('showvcode',true);
}
</script>
  <{/if}>
  
  <!--回复 -->
<div id="repay_box" class="repay_box" style="display:none">
<div class="arrw"></div>
<form class=" division" method="post" onsubmit='checkFormReqs(event);'>
<div class="review_textarea">
  <ul>
    <li><{input type="textarea" class="x-input inputstyle"  vtype="sendcomments&&required" rows="5" name="comment" style="display:block;width:98%;"}>
      <div class="infotips" align="right"><span class="price1">0</span>/1000</div>
    </li>
     <{if $login eq "nologin"}>
      <li><{t}>联系方式<{/t}><{input type="text" required="true" size=20 name="contact"}><span class="infotips"><{t}>(可以是电话、email、qq等)<{/t}></span>
      	</li>
      	 <{else}>
    <li>
      <input type="checkbox" name="hidden_name" value="YES"/>
      匿名发表</li>
      <{/if}>
     <{if $discussshow == "on"}>
	<li><{t}>验证码: <{/t}><{input type="number" style=" width:70px" vtype=required size="4" maxlength="4" onclick="showvcode(this)" onchange="replyVcodeCheck(this)" name="replyverifyCode"}>&nbsp;<img style="display:none" codesrc="<{link app="b2c" ctl="site_comment" act="gen_replyvcode"}>"/><a href="javascript:void(0);" onclick="changereplyimg(this);"class="link_blue">&nbsp;<{t}>点击更换新图片<{/t}></a><span></span></li>
    <{/if}>
	<li style="padding-left:0">
      <button id="cart-coupon-submitBtn" class="btn commentbtn " type="submit"> <span><span> <{t}>提交回复<{/t}></span></span> </button>
      <span style="cursor:pointer" class="link_blue" onclick="cancle();">取消回复</span>
      
  </li>
  </ul>
</div>
</form>
</div>
  <{if $goodsRecommend == 'true'}>
  <div class="section pdtdetail" style="display:none" tab="<{t}>商品推荐<{/t}>">
    <div class="FormWrap">
      <h4><{t}>商品推荐<{/t}></h4>
      <p style="padding:5px 0"><{t}>您可以把该商品推荐给您的好友,在下面输入您好友的E-mail地址，我们会发送邮件通知您的好友！<{/t}></p>
      <div class="division">
        <form method="POST" action="<{link app=b2c ctl=site_product act=recooemd}>">
          <input type="hidden" name="goods_id" value="<{$goods.goods_id}>">
          <input type="hidden" name="goods_name" value="<{$goods.name}>">
          <table border="0" cellspacing="0" cellpadding="0" class="forform">
            <tr>
              <th><{t}>您的姓名:<{/t}></th>
              <td><{input type='text'  class="_x_ipt" name="name" vtype=required size="30"}></td>
            </tr>
            <tr>
              <th><{t}>您好友的邮箱:<{/t}></th>
              <td><{input type='text' vtype="email&&required" class="_x_ipt" name="email"  size="30" value=$member.email}></td>
              <td><button id="cart-coupon-submitBtn" class="btn dicusbtn " type="submit"> <span><span> <{t}>提交<{/t}></span></span> </button></td>
            </tr>
          </table>
        </form>
      </div>
    </div>
  </div>
  <{/if}> </div>
<img src="<{link app=b2c ctl=site_product act=cron arg=$goods.goods_id }>" width="1" border="none" height="1"> 